#ifndef D_RENDERMANAGER_H
#define D_RENDERMANAGER_H

#include <wx/string.h>

class D_DrawBaseElement;
class ByteTrain;
class FileManager;
class wxMDIParentFrame;
class wxMDIChildFrame;
class wxClientDC;
class wxPaintDC;
class wxDC;
class D_DrawProject;
class wxSize;
class wxMemoryDC;
class wxBitmap;

class RenderManager{
	public:
	RenderManager(wxMDIParentFrame* owner_frame);
	~RenderManager();
	
	void SetClientFrame(wxMDIChildFrame* new_ptr);
	void Render(wxPaintDC* dc);
	void SetProject(D_DrawProject* project);
	void ActivateDotGrid();
	void DeactivateDotGrid();
	bool IsDotGridActive();
	void RenderToDC(wxDC* dc);
			
	private:
	
	void RenderBackground(wxDC* dc);
	void RenderGrid(wxDC* dc, wxSize* client_size);
	void RenderBorders(wxDC* dc, wxSize* client_size);
	int Limit(int value, int limit);
	
	wxMDIParentFrame* m_owner_frame;
	wxMDIChildFrame* m_client_frame;
	D_DrawProject* m_project;
	bool m_grid_precached;
	wxMemoryDC* m_grid_dc;
	wxBitmap* m_grid_bitmap;
	bool m_use_dot_grid;
	};

#endif